package com.indexingsystem.boss.entity;

import java.io.Serializable;
import java.util.Date;

import com.alibaba.fastjson.annotation.JSONField;

public class Roles implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String roleId;

	private String roleName;

	private String roleCode;

	private String parentRoleId;

	private String institutionOrder;

	private String roleGroupId;

	private int autoAssignment;

	private String description;

	
	private Date createDate;

	private String createUserId;

	private Date lastUpdatedDate;

	private String lastUpdatedUserId;

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId == null ? null : roleId.trim();
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName == null ? null : roleName.trim();
	}

	public String getParentRoleId() {
		return parentRoleId;
	}

	public void setParentRoleId(String parentRoleId) {
		this.parentRoleId = parentRoleId;
	}

	public String getInstitutionOrder() {
		return institutionOrder;
	}

	public void setInstitutionOrder(String institutionOrder) {
		this.institutionOrder = institutionOrder;
	}

	public String getRoleGroupId() {
		return roleGroupId;
	}

	public void setRoleGroupId(String roleGroupId) {
		this.roleGroupId = roleGroupId == null ? null : roleGroupId.trim();
	}

	public int getAutoAssignment() {
		return autoAssignment;
	}

	public void setAutoAssignment(int autoAssignment) {
		this.autoAssignment = autoAssignment;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description == null ? null : description.trim();
	}

	public Date getCreateDate() {
		return createDate;
	}

	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(String createUserId) {
		this.createUserId = createUserId == null ? null : createUserId.trim();
	}

	public Date getLastUpdatedDate() {
		return lastUpdatedDate;
	}

	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	public void setLastUpdatedDate(Date lastUpdatedDate) {
		this.lastUpdatedDate = lastUpdatedDate;
	}

	public String getLastUpdatedUserId() {
		return lastUpdatedUserId;
	}

	public void setLastUpdatedUserId(String lastUpdatedUserId) {
		this.lastUpdatedUserId = lastUpdatedUserId == null ? null : lastUpdatedUserId.trim();
	}

	public String getRoleCode() {
		return roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}	

	@Override
    public int hashCode()
    {
        final int prime = 31;
        int result = 1;
        result = prime * result + autoAssignment;
        result = prime * result + ((createDate == null) ? 0 : createDate.hashCode());
        result = prime * result + ((createUserId == null) ? 0 : createUserId.hashCode());
        result = prime * result + ((description == null) ? 0 : description.hashCode());
        result = prime * result + ((institutionOrder == null) ? 0 : institutionOrder.hashCode());
        result = prime * result + ((lastUpdatedDate == null) ? 0 : lastUpdatedDate.hashCode());
        result = prime * result + ((lastUpdatedUserId == null) ? 0 : lastUpdatedUserId.hashCode());
        result = prime * result + ((parentRoleId == null) ? 0 : parentRoleId.hashCode());
        result = prime * result + ((roleCode == null) ? 0 : roleCode.hashCode());
        result = prime * result + ((roleGroupId == null) ? 0 : roleGroupId.hashCode());
        result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
        result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        Roles other = (Roles)obj;
        if (autoAssignment != other.autoAssignment) return false;
        if (createDate == null)
        {
            if (other.createDate != null) return false;
        }
        else if (!createDate.equals(other.createDate)) return false;
        if (createUserId == null)
        {
            if (other.createUserId != null) return false;
        }
        else if (!createUserId.equals(other.createUserId)) return false;
        if (description == null)
        {
            if (other.description != null) return false;
        }
        else if (!description.equals(other.description)) return false;
        if (institutionOrder == null)
        {
            if (other.institutionOrder != null) return false;
        }
        else if (!institutionOrder.equals(other.institutionOrder)) return false;
        if (lastUpdatedDate == null)
        {
            if (other.lastUpdatedDate != null) return false;
        }
        else if (!lastUpdatedDate.equals(other.lastUpdatedDate)) return false;
        if (lastUpdatedUserId == null)
        {
            if (other.lastUpdatedUserId != null) return false;
        }
        else if (!lastUpdatedUserId.equals(other.lastUpdatedUserId)) return false;
        if (parentRoleId == null)
        {
            if (other.parentRoleId != null) return false;
        }
        else if (!parentRoleId.equals(other.parentRoleId)) return false;
        if (roleCode == null)
        {
            if (other.roleCode != null) return false;
        }
        else if (!roleCode.equals(other.roleCode)) return false;
        if (roleGroupId == null)
        {
            if (other.roleGroupId != null) return false;
        }
        else if (!roleGroupId.equals(other.roleGroupId)) return false;
        if (roleId == null)
        {
            if (other.roleId != null) return false;
        }
        else if (!roleId.equals(other.roleId)) return false;
        if (roleName == null)
        {
            if (other.roleName != null) return false;
        }
        else if (!roleName.equals(other.roleName)) return false;
        return true;
    }

    public Roles() {
		// TODO Auto-generated constructor stub
	}

	public Roles(String roleId, String roleName, String roleCode, String parentRoleId, String institutionOrder,
			String roleGroupId, int autoAssignment, String description, Date createDate, String createUserId,
			Date lastUpdatedDate, String lastUpdatedUserId) {
		super();
		this.roleId = roleId;
		this.roleName = roleName;
		this.roleCode = roleCode;
		this.parentRoleId = parentRoleId;
		this.institutionOrder = institutionOrder;
		this.roleGroupId = roleGroupId;
		this.autoAssignment = autoAssignment;
		this.description = description;
		this.createDate = createDate;
		this.createUserId = createUserId;
		this.lastUpdatedDate = lastUpdatedDate;
		this.lastUpdatedUserId = lastUpdatedUserId;
	}

	@Override
	public String toString() {
		return "Roles [roleId=" + roleId + ", roleName=" + roleName + ", roleCode=" + roleCode + ", parentRoleId="
				+ parentRoleId + ", institutionOrder=" + institutionOrder + ", roleGroupId=" + roleGroupId
				+ ", autoAssignment=" + autoAssignment + ", description=" + description + ", createDate=" + createDate
				+ ", createUserId=" + createUserId + ", lastUpdatedDate=" + lastUpdatedDate + ", lastUpdatedUserId="
				+ lastUpdatedUserId + "]";
	}
}